class counts(dict):
    def __missing__(self, key):
        return 0

C=counts()
data = open('/etc/passwd').read()
for ch in data:
    C[ch] += 1
print C
